Heap Sort ヒープソート
Sorting ソート 整列アルゴリズム Algorithmsの一種
特徴
O(n log n)
入力長が増えても高速
データの出現順序による時間計算量 time complexity変化小
in-place Algorithms
空間計算量 space complexity O(1)
not 安定
Heap ヒープ
Tree 木構造
最小値を常に取り出せるようにするアルゴリズム Algorithms
配列 Arrayに新たな要素を追加したり、要素を削除したりすることが想定される場面
利点
O(n log n)
table:Complexity
Name Best Average Worst Memory Stable Comments
Heap sort O(n log n) O(n log n) O(n log n) 1 No
GitHub.icon
https://github.com/KiichiSugihara/my-javascript-algorithms/tree/master/Sorting/HeapSort